<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>订单发货</title>
<link href="__PUBLIC__/admin/css/xc.min.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/admin/css/xc.admin.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/lib/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.js"></script> 
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.admin.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/common-1.0.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/layer/layer.js"></script>
</head>
<body>
<div class="pd-20">
  <form action="" method="post" class="form form-horizontal" id="myform">
    <input type="hidden" name="id" value="{$ores.or_id}">
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>流水号：</label>
      <div class="formControls col-8 mt-3">{$ores.or_batch}</div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>收件人：</label>
      <div class="formControls col-8 mt-3">{$ores.addre.aname}&nbsp;&nbsp;{$ores.addre.phone}</div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>收件地址：</label>
      <div class="formControls col-8 mt-3">{$ores.addre.addre}</div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>选择快递公司：</label>
      <div class="formControls col-6"> <span class="select-box">
        <select class="select" size="1" id="type" name="type">
          <foreach name='etype' item='vo' key='k'>
          <option value="{$k}">{$vo.0}</option>
          </foreach>
        </select></span>
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>快递单号：</label>
      <div class="formControls col-6">
        <input type="text" class="input-text" id="numb" name="numb" placeholder="请填写快递单号" value="{$res.ad_link}">
      </div>
    </div>
    <div class="row cl">
      <div class="col-9 col-offset-3">
        <button type="button" id="sub" name="sub" class="btn btn-primary radius" onClick="checkSubmit()"><i class='Hui-iconfont'>&#xe632;</i> 确认发货</button>
        <button class="btn btn-default radius" type="button" onClick="layer_close();"><i class='Hui-iconfont'>&#xe66b;</i> 取消</button>
      </div>
    </div>
  </form>
</div>
<script type="text/javascript">
//按回车件触发提交
document.onkeydown=function(event){
	var e = event || window.event || arguments.callee.caller.arguments[0];
	if(e && e.keyCode==13){ // enter 键
		checkSubmit();
	}
}; 
//提交数据
function checkSubmit()
{
	var type = $.trim($('#type').val());
	var numb = $.trim($('#numb').val());
	if(type == ''){
		layer.msg('请选择快递公司', {icon: 2});
		return false;
	}if(numb == ''){
		layer.msg('快递单号不能为空!', {icon: 2});
		return false;
	}
	$.ajax({
		type : 'post',
		url : '__MODULE__/Order/prsendGoods',
		data : $("#myform").serialize(),
		dataType : 'json',
		success : function(res){
			if(res.status == 1){
				layer.msg(res.msg,{icon:1,time:2000},function(){
					// 先获取窗口索引，才能关闭窗口  
					var index = parent.layer.getFrameIndex(window.name);
					parent.layer.close(index);
				});
				parent.call_back_fun('success');
			}else{
				layer.msg(res.msg, {icon: 2});
			}
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			layer.alert('网络失败，请刷新页面后重试',{icon:2});
		}
	})
}
</script>
</body>
</html>